# -*- coding: utf-8 -*-
"""
通过直接下载方式存储图片
"""
import string

import requests


class Downloader:
    def __init__(self):
        pass

    @staticmethod
    def download(url: string = None,path:string = None,filename:string = None):
        """
        图片下载
        :param url: 图片地址
        :param path: 图片路径
        :param filename: 文件名
        :return: Bool
        """
        if url is None:
            return True
        content = requests.get(url).content
        with open(path+filename, 'wb') as f:
            f.write(content)
        return True
